﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using NewDDSys.Entity;
using NewDDSys.IBLL;
using NewDDSys.IDAL;
using NewDDSys.Factory;
using NewDDSys.Utility;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class Web_WOTHER : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        btnOK.Attributes.Add("onclick", "javascript:if(confirm('" + "确认无误，并提交么？" + "')== false) return false;");
    }
    protected void btnOK_Click(object sender, EventArgs e)
    {
        int checkValue = 0;
        WeekotherInfo wo = new WeekotherInfo();
        wo.Sday = Convert.ToDateTime(txtSday.Text.ToString()).ToShortDateString().ToString();
        wo.Eday = Convert.ToDateTime(txtEday.Text.ToString()).ToShortDateString().ToString();
        wo.Info = txtInfo.Text.ToString();
        wo.Xday = DateTime.Now.ToShortDateString().ToString();
        wo.Num = BLLFactory.CreateWeekotherBLL().AUTOID();
        checkValue = BLLFactory.CreateWeekotherBLL().AddWeekother(wo);
        if (checkValue >= 1)
        {
            Response.Write(" <script   language=javascript> window.alert( ' 提交成功！ ');</script> ");
        }
        
        if (txtJx.Text.ToString() != "")
            BLLFactory.CreateWeekotherBLL().UpdateWeekotherJX(wo.Num, txtJx.Text.ToString());
        Response.Redirect("WOJL.aspx");
    }
    protected void btnRepeat_Click(object sender, EventArgs e)
    {
        txtSday.Text = "";
        txtEday.Text = "";
        txtInfo.Text = "";
        txtJx.Text = "";
    }
}
